﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Flight
{
    class Program
    {
        static void Main(string[] args)
        {
            int count = 0;
            string choice = "yes";
            List<Flight> voyages = new List<Flight>();

            do
            {
                Flight passage = new Flight();
                passage.FillValuesOfFlights();
                Console.WriteLine("Хотите добавить еще один рейс: ");
                choice = Console.ReadLine();
                Console.WriteLine();
                voyages.Add(passage);
                count++;
            }
            while (choice == "yes");

            Console.WriteLine();
            Console.WriteLine("Выберите пункт назначения: ");
            string station = Console.ReadLine();

            for (int i = 0; i < count; i++)
            {
                if (station == voyages[i].destination)
                {
                    voyages[i].PrintInformationAboutFlight();
                    Console.WriteLine();
                }  
            }

            Console.ReadKey();
        }
    }

    

}
